<template>
  <div id="centerRight1">
    <dv-scroll-board class="dv-scr-board" :config="config" />
  </div>
</template>

<script>
import { getEquipment } from "@/api/index";
export default {
  props: {
    dataList1: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {
      config: {
        header: [
          "工单号",
          "料号",
          "班次",
          "作业员",
          "工艺",
          "工单数量",
          "完成数量",
          "不良数量",
          "完成率",
        ],
        data: [
          [
            "41006733",
            "MP-02650B03-E01",
            "夜班",
            "李兰英",
            "铆压尾部端子及头部黄线小端子",
            "100",
            "70",
            "0",
            "70.00%",
          ],
          [
            "41006733",
            "MP-02650B03-E01",
            "夜班",
            "李兰英",
            "铆压尾部端子及头部黄线小端子",
            "100",
            "70",
            "0",
            "70.00%",
          ],
          [
            "41006733",
            "MP-02650B03-E01",
            "夜班",
            "李兰英",
            "铆压尾部端子及头部黄线小端子",
            "100",
            "70",
            "0",
            "70.00%",
          ],
          [
            "41006733",
            "MP-02650B03-E01",
            "夜班",
            "李兰英",
            "铆压尾部端子及头部黄线小端子",
            "100",
            "70",
            "0",
            "70.00%",
          ],
          [
            "41006733",
            "MP-02650B03-E01",
            "夜班",
            "李兰英",
            "铆压尾部端子及头部黄线小端子",
            "100",
            "70",
            "0",
            "70.00%",
          ],
          [
            "41006733",
            "MP-02650B03-E01",
            "夜班",
            "李兰英",
            "铆压尾部端子及头部黄线小端子",
            "100",
            "70",
            "0",
            "70.00%",
          ],
          [
            "41006733",
            "MP-02650B03-E01",
            "夜班",
            "李兰英",
            "铆压尾部端子及头部黄线小端子",
            "100",
            "70",
            "0",
            "70.00%",
          ],
          [
            "41006733",
            "MP-02650B03-E01",
            "夜班",
            "李兰英",
            "铆压尾部端子及头部黄线小端子",
            "100",
            "70",
            "0",
            "70.00%",
          ],
          [
            "41006733",
            "MP-02650B03-E01",
            "夜班",
            "李兰英",
            "铆压尾部端子及头部黄线小端子",
            "100",
            "70",
            "0",
            "70.00%",
          ],
        ],
        rowNum: 7, //表格行数
        headerHeight: 40,
        headerBGC: "", //表头
        oddRowBGC: "#173653", //奇数行
        evenRowBGC: "", //偶数行
        index: true,
        indexHeader: "序号",
        columnWidth: [55, 90, 150, 60, 75, 230, 90, 90, 90, 78],
        align: [
          "center",
          "center",
          "center",
          "center",
          "center",
          "center",
          "center",
          "center",
          "center",
          "center",
        ],
      },
    };
  },
  watch: {
    dataList1: {
      handler(newVal) {
        this.getrequests();
      },
      deep: true,
    },
  },
  methods: {
    getrequests() {
      let data = [];
      this.dataList1.forEach((item) => {
        data.push([
          item.equipmentName,
          item.equipmentCode,
          item.workOrder,
          item.workOrderMaterial,
          item.schedulingName,
          item.number,
          Math.round(
            (item.onTime /
              (item.onTime + item.noTime + item.ngTime + item.offTime)) *
              100 || 0.0
          ) + "%",
          item.userName,
        ]);
      });
      this.config.data = data;
      this.config = { ...this.config };
    },
  },
  mounted() {
    // this.getrequests();
  },
};
</script>

<style lang="scss" scoped>
::v-deep .dv-scroll-board {
  height: 38vh;
  width: 98%;
  margin: 10px 0 10px 1%;
  .header {
    font-size: 16px;
    color: #71a3fa !important;
    text-align: center;
    // font-weight: 700;
    :nth-child(1) {
      color: #3ecff3;
    }
  }
  .rows {
    .row-item {
      color: #aec8f3;
      font-size: 14px;
    }
    .ceil:nth-child(1) {
      color: #28bbe0;
      font-weight: 700;
    }
  }
}
</style>
